package com.cskaoyan.market.service.impl;

import com.cskaoyan.market.db.domain.SelfMarketOrderGoodsInfo;
import com.cskaoyan.market.db.domain.SelfMarketOrderInfo;
import com.cskaoyan.market.db.mapper.MarketUserMapper;
import com.cskaoyan.market.db.mapper.SelfMarketOrderGoodsMapper;
import com.cskaoyan.market.service.MarketStatService;
import com.cskaoyan.market.util.MyBatisUtil;
import com.cskaoyan.market.vo.Row;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class MarketStatServiceImpl implements MarketStatService {
    @Autowired
    SelfMarketOrderGoodsMapper mapper;
    @Override
    public List<SelfMarketOrderGoodsInfo> getProductsInfo() {
        return mapper.selectOrderGoodsInfoForProductStat();
    }

    @Override
    public List<SelfMarketOrderInfo> getOrderInfo() {
        return mapper.selectOrderInfoForOrderStat();
    }
    @Autowired
    MarketUserMapper marketUserMapper;
    @Override
    public Map<String, Object> user() {
        List<Row> rows=marketUserMapper.selectUser();
        System.out.println(rows);
        Map<String,Object> map = new HashMap<>();
        String[] s={"day","users"};
        map.put("rows",rows);
        map.put("columns",s);
        return map;
    }
}
